#@head() 
#@header()
#@aside("user")
  <div class="content-wrapper">
    <section class="content">
      <div class="row">
        <div class="col-md-12">
          <!-- Horizontal Form -->
          <div class="box box-info">
            <div class="box-header with-border">
              <h3 class="box-title">添加客服</h3>
            </div>
  
			<input type="hidden" name="id"  value="#(item.id??)" />
              <div class="box-body">
				<div class="form-group">
					<label for="inputEmail3" class="col-sm-2 control-label">所属用户组</label>
					<div class="col-sm-10">
						<select  name="level" id="level" class="form-control">
							<option value="0" #if(item.level??==0)selected#end>禁止</option>
							<option value="10" #if(item.level??==10)selected#end>普通</option>
							<option value="30" #if(item.level??==30)selected#end>中级</option>
							<option value="50" #if(item.level??==50)selected#end>高级</option>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label for="inputEmail3" class="col-sm-2 control-label">头像</label>
					<div class="col-sm-10">
						<input type="file" name="avatar" id="avatar" class="form-control" />
					</div>
				</div>
				<div class="form-group">
					<label for="inputEmail3" class="col-sm-2 control-label">姓名</label>
					<div class="col-sm-10">
						<input name="realname" id="realname" class="form-control"  value="#(item.realname)" placeholder="请输入真实姓名..."/>
					</div>
				</div>
				<div class="form-group">
					<label for="inputPassword3" class="col-sm-2 control-label">手机号码</label>
					<div class="col-sm-10">
						<input type="text" id="phone" name="phone" class="form-control" value="#(item.phone)" placeholder="请输入手机号码..." />
					</div>
				</div>
				<div class="form-group">
					<label for="inputEmail3" class="col-sm-2 control-label">所属部门</label>
					<div class="col-sm-10">
						<select  name="department" id="deartment" class="form-control">
							<option value="客服部" #if(item.department??=="客服部")selected#end>客服部</option>
							<option value="技术部" #if(item.department??=="技术部")selected#end>技术部</option>
							<option value="人事部" #if(item.department??=="人事部")selected#end>人事部</option>
							<option value="财务部" #if(item.department??=="财务部")selected#end>财务部</option>
						</select>
					</div>
				</div>
              </div>
				<div class="box-footer">
					<button type="submit" class="btn btn-info center-block">写好了</button>
            	</div>
          </div>
          <!-- /.box -->
        </div>
        <!--/.col (right) -->
      </div>
      <!-- /.row -->
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
	#@footer()
	<script>
	$(function(){
		
	});
    </script>
    <script src="#(path)/dist/plugins/jQuery/jquery-2.2.3.min.js"></script>
	<script src="#(path)/dist/bootstrap/js/bootstrap.min.js"></script>
	<script src="#(path)/dist/js/elink.js"></script>
	<script src="#(path)/dist/plugins/layer/layer.js"></script>
    <script>
	$(function() {
			$('.submit').click(function(){
				ajax("#(path)/user/add",
						{"level":$('#level').val(),"avatar":$('#avatar').val(),"realname":$('realname').val(),"phone":$('#phone').val(),"deartment":$('deartment').val()}, function(data){
					if(data.code=='success'){
						layer.msg(data.msg, {icon:1},function(){
							// 添加成功，执行跳转...
							window.location.href="#(path)/user/add";
						});
					}else if(data.code=='error'){
						layer.msg(data.msg, {icon:2},function(){
							// 失败，提醒错误...
						});
					}
				});
			});
	});
	</script>
</body>
</html>